var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = e("sdkConfig"),
    a = e("AD"),
    i = e("MiniGameSDK"),
    r = cc._decorator,
    s = r.ccclass,
    l = r.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (t.platfrom = n.EPlatform.VIVO), t;
        }
        return (
            __extends(t, e),
            (t.prototype.onLoad = function () {
                var e = this;
                switch (cc.sys.platform) {
                    case cc.sys.VIVO_GAME:
                        n.default.platform = n.EPlatform.VIVO;
                        break;
                    case cc.sys.OPPO_GAME:
                        n.default.platform = n.EPlatform.OPPO;
                        break;
                    case cc.sys.HUAWEI_GAME:
                        n.default.platform = n.EPlatform.HUAWEI;
                        break;
                    case cc.sys.WECHAT_GAME:
                        n.default.platform = n.EPlatform.WX;
                        break;
                    case cc.sys.BYTEDANCE_GAME:
                        n.default.platform = n.EPlatform.TikTok;
                        break;  
                            
                    case 101:
                        this.platfrom == n.EPlatform.No_AD
                            ? (n.default.platform = n.EPlatform.No_AD)
                            : (n.default.platform = n.EPlatform.test);
                        break;
                    default:
                        n.default.platform = this.platfrom;
                }
                (n.default.channelId = n.default.platform),
                    n.default.platform == n.EPlatform.UC &&
                        uc.setEnableDebug({
                            enableDebug: !1,
                            complete: function () {
                                console.log("uc.setEnableDebug openDebug. ");
                            }
                        }),
                    this.scheduleOnce(function () {
                        cc.sys.platform === cc.sys.VIVO_GAME ||
                        cc.sys.platform === cc.sys.OPPO_GAME ||
                        cc.sys.platform === cc.sys.HUAWEI_GAME
                            ? i.default.getNetworkType(function (t) {
                                  t
                                      ? a.default.getInstance().init(e.GoLoadView.bind(e))
                                      : i.default.showDialog("提示", "无网络，请退出游戏重启网络", function () {
                                            i.default.exitApplication();
                                        });
                              })
                            : a.default.getInstance().init(e.GoLoadView.bind(e));
                    }, 0.1);
            }),
            (t.prototype.GoLoadView = function () {
                cc.director.loadScene("Login", function () {
                    console.log("======进入Login场景=======");
                });
            }),
            __decorate([l({type: cc.Enum(n.EPlatform)})], t.prototype, "platfrom", void 0),
            __decorate([s], t)
        );
    })(cc.Component);
o.default = c;
